package com.stone.business.weekplan.service;

import java.util.ArrayList;

import com.stone.business.tabl.pojo.TTablXsb;
import com.stone.business.weekplan.pojo.TWeekplan;
import com.stone.common.pojo.TFile;

import frm.ssh.service.BaseService;

public class WeekplanService extends BaseService {
	public String doSave(TWeekplan entity, ArrayList<TFile> fileList) {
		if (entity.getId() == 0) {
			super.save(entity);
			if (fileList != null && fileList.size() > 0) {
				for(int i = 0; i < fileList.size(); i++){
					TFile file = fileList.get(i);
					file.setTableid(entity.getId());
					super.save(file);
				}
			}
		} else {
			if (fileList != null && fileList.size() > 0) {
				for(int i = 0; i < fileList.size(); i++){
					TFile file = fileList.get(i);
					super.save(file);
				}
			}
			super.update(entity);

		}
		return "保存成功。";
	}
}
